drm/vmwgfx: Validate the box size for the snooped cursor
authorZack Rusin <zackr@vmware.com>
Wed, 26 Oct 2022 03:19:35 +0000 (23:19 -0400)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 21 Jan 2023 14:35:48 +0000 (14:35 +0000)
commit97fc19ca15732b60240d365aa287f20e4e1249bb
tree7bd03591c620c0ee58a5a95670e5e95f95170120
parentd9e59aeb88f18c64f90ef260bb5005b1a0051c98
drm/vmwgfx: Validate the box size for the snooped cursor

Origin: https://git.kernel.org/linus/4cf949c7fafe21e085a4ee386bb2dade9067316e
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-36280

Invalid userspace dma surface copies could potentially overflow
the memcpy from the surface to the snooped image leading to crashes.
To fix it the dimensions of the copybox have to be validated
against the expected size of the snooped cursor.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: 2ac863719e51 ("vmwgfx: Snoop DMA transfers with non-covering sizes")
Cc: <stable@vger.kernel.org> # v3.2+
Reviewed-by: Michael Banack <banackm@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026031936.1004280-1-zack@kde.org
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name drm-vmwgfx-Validate-the-box-size-for-the-snooped-cur.patch
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c